package com.da.javatest.jvm;

import java.net.URL;

import sun.misc.Launcher;

public class Test02 {
    public static void main(String[] args) throws ClassNotFoundException {
        System.out.println("启动类加载器");
        URL[] urLs = Launcher.getBootstrapClassPath().getURLs();
        for (URL url : urLs) {
            System.out.println(url);
        }

        System.out.println("拓展类加载器");
        String property = System.getProperty("java.ext.dirs");
        for (String url : property.split(";")) {
            System.out.println(url);
        }

        ClassLoader c1 = Class.forName("java.lang.String").getClassLoader();
        System.out.println(c1);

        ClassLoader c2 = Thread.currentThread().getContextClassLoader();
        System.out.println(c2);

        ClassLoader c3 = ClassLoader.getSystemClassLoader().getParent();
        System.out.println(c3);
    }
}
